<!DOCTYPE html>
<html lang="en" class="md device-pixel-ratio-3 device-retina device-desktop device-windows support-position-sticky" >

<head>
    <meta charset="utf-8" />
    <meta name="theme-color" content="#000000" />
    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1" />
    <link rel="apple-touch-icon" href="favicon.ico" />
    <meta name="apple-mobile-web-app-title" content="坏坏漫画" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="referrer" content="never">

    <script type="text/javascript" src="js/debug.js"></script>
    <link rel="shortcut icon" href="./favicon.ico" />
    <title>坏坏漫画-日韩污漫韩国色漫-色漫大全-搜索</title>
    <link href="css/main.48b4036a.css" rel="stylesheet">
    <link href="css/aui.css" rel="stylesheet" />
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/layer.js"></script>
    <script type="text/javascript" src="js/jquery.lazyload.min.js"></script>
    <script type="text/javascript" src="js/template-web.js"></script>
    <script type="text/javascript" src="js/aui-toast.js"></script>
    <script type="text/javascript" src="js/aui-dialog.js"></script>
    <script type="text/javascript" src="js/config.js" charset="utf-8"></script>
<div style="display: none;">
</div>  
    
    <script type="text/javascript" src="js/jquery.cookie.js"></script>

</head>

<body >
    <div id="root" style="height: 100%;">
        <div id="framework7-root" class="framework7-root ">
            <div class="panel-backdrop"></div>
            <div class="panel panel-left panel-reveal">
                <div id="chapterDirectory" class="page">
                    <div class="page-content">
                        <div class="block-title">目录</div>
                        <div class="no-margin-bottom list virtual-list">
                            <ul id="leftpannel" style="height: 5667.84px;">
                                <li class="bg-color-default text-color-primary" style="height: 0.48rem; top: 0px; font-size: 110%; font-weight: 700;"><a class="item-link" href="#">
                                        <div class="item-content">
                                            
                                            <div class="item-inner">
                                                <div class="item-title">第1話-&lt;1&gt;</div>
                                            </div>
                                        </div>
                                    </a></li>
                                
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-right panel-reveal">
                <!-- 侧边栏 -->
                <div class="page" id="right-page">
                    <script>
                        $("#right-page").load("right-page.html");
                    </script>
                </div>
            </div>
            <div class="view view-main">
                
            <div class="view view-main">
                <div class="page page-current no-toolbar no-swipeback" data-name="readerSearch">
                    <div class="navbar">
                        <div class="navbar-inner sliding">
                            <form class="searchbar searchbar-enabled">
                                <div class="searchbar-inner">
                                    <div class="searchbar-input-wrap">
                                        <input placeholder="书名/作者" id="searchbar" type="search" class="input-with-value"
                                            style="-webkit-user-select:text !important;">
                                        <!--<input placeholder="书名/作者" id="searchbar" type="text" class="input-with-value">-->
                                        <i class="searchbar-icon"></i>
                                        <span class="input-clear-button"></span>
                                    </div>
                                    <span class="searchbar-disable-button" onclick="history.go(-1);">Cancel</span>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="page-content page-content-old">
                        <div class="reader-search-list-view list no-hairlines">
                            <ul>
                                <div class="list" style="margin-top:0px">
                                    <ul>


                                        <li class="no-padding height-0 item-divider"><span></span></li>
                                    </ul>
                                </div>
                                <div class="accordion-item-content">
                                    <div class="list">
                                        <ul>
                                            <li><a class="item-link list-button" data-tab="false">清空搜索记录</a></li>
                                        </ul>
                                    </div>
                                </div>
                                </li>
                            </ul>
                        </div>
                        <div class="no-margin list no-hairlines">
                            <ul>
                                <li class="normal-divider-line item-divider"><span></span></li>
                            </ul>
                        </div>
                        <div id="jphc" class="reader-zone-list-view list no-hairlines">
                            <ul>
                                <li class="">
                                    <div class="item-content">
                                        <div class="item-inner">
                                            <div class="item-title">大家都在看</div>
                                            <div class="item-after"></div>
                                        </div>
                                    </div>
                                </li>
                                <li class="reader-zone-list-view-books">
                                    <div class="item-content">
                                        <div class="item-inner">
                                            <div class="display-flex justify-content-space-between width-100" id="jphc1">

                                            </div>
                                        </div>
                                    </div>
                                </li>
                                <li class="">
                                    <div class="item-content">
                                        <div class="item-inner"><a
                                                class="replace-btn width-100 button button-round button-fill button-small"
                                                href="javascript:void(0)" onclick="changejphc();"><span>换一换</span></a></div>
                                    </div>
                                </li>
                                <li class="normal-divider-line item-divider"><span></span></li>
                            </ul>
                        </div>
                        <div class="reader-zone-list-view list no-hairlines">
                            <ul>
                                <li class="">
                                    <div class="item-content">
                                        <div class="item-inner">
                                            <div class="item-title">猜你喜欢</div>
                                            <div class="item-after"></div>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                            <ul id="cnxh">
                            </ul>
                            <ul>
                                <li class="">
                                    <div class="item-content">
                                        <div class="item-inner"><a
                                                class="replace-btn width-100 button button-round button-fill button-small"
                                                href="javascript:void(0)" onclick="changecnxh();"><span>换一换</span></a></div>
                                    </div>
                                </li>
                                <li class="normal-divider-line item-divider"><span></span></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

            <script type="text/html" id="booklist">
            {{each data  value i}}
            <a class="reader-book reader-book-default" href="/book.html?id={{value['id']}}">
                <div class="">
                    <div class="cover">
                                <img src="{{value['image']}}" alt="">
                        {{if value['mhstatus']==0}}
                            <span class="status" data-status="serialized">连载</span>
                        {{/if}}
                        {{if value['mhstatus']==1}}
                            <span class="status" data-status="finish">完结</span>
                        {{/if}}
                        {{if value['h']==1}}
                        <span class="status" data-status="finish" style="right:0rem; background:#39F; left:inherit">18+</span>
                    {{/if}}
                        {{if value['tjswitch']==1}}
                            <span class="type" data-type="recommend"></span>
                        {{/if}}

                        {{if value['isjingpin']==1}}
                            <span class="type" data-type="competitive"></span>
                        {{/if}}

                        {{if value['xianmian']==1}}
                            <span class="type" data-type="free_in_limit_time"></span>
                        {{/if}}
                    </div>
                    <span class="name">{{value['title']}}</span>
                    <div class="footer">
                        <span class="score"><i class="icon material-icons">star</i> {{value['mark']}}</span>
                        <span class="readCount"><i class="icon material-icons">remove_red_eye</i> {{value['view']}}</span>
                    </div>
                </div>
            </a>
            {{/each}}
            </script>

            <script type="text/html" id="booklist2">
            {{each data  value i}}
            <li class="reader-zone-list-view-books">
            <div class="item-content">
                <div class="item-inner">
                    <div class="display-flex justify-content-space-between width-100">
                        <a class="reader-book reader-book-default reader-book-round reader-book-media" href="/book.html?id={{value['id']}}">
                            <div class="">
                                <div class="cover">
                                <img src="{{value['image']}}"/>
                                    {{if value['mhstatus']==0}}
                                        <span class="status" data-status="serialized">连载</span>
                                    {{/if}}
                                    {{if value['mhstatus']==1}}
                                        <span class="status" data-status="finish">完结</span>
                                    {{/if}}

                                    {{if value['tjswitch']==1}}
                                        <span class="type" data-type="recommend"></span>
                                    {{/if}}

                                    {{if value['isjingpin']==1}}
                                        <span class="type" data-type="competitive"></span>
                                    {{/if}}
                                    {{if value['xianmian']==1}}
                                        <span class="type" data-type="free_in_limit_time"></span>
                                    {{/if}}
                                </div>
                                <span class="name">{{value['title']}}</span>
                                <p class="desc">{{value['desc']}}</p>
                                <div class="footer">
                                    <span class="score"><i class="icon material-icons">star</i> {{value['mark']}}</span>
                                    <span class="readCount"><i class="icon material-icons">remove_red_eye</i> {{value['view']}}</span>
                                    <span class="author">作者：{{value['auther']}}</span>
                                </div>
                            </div>
                        </a>
                    </div>
                </div>
            </div>
            </li>
            {{/each}}
            </script>

            </div>
            <div class="framework7-modals"></div>
            <div class="actions-backdrop"></div>
            <div class="dialog-backdrop"></div>
            <div class="dialog dialog-buttons-1 dialog-buttons-vertical reader-copy-modal modal-in" style="display: none; margin-top: -372px;">
                <div class="dialog-inner">
                    <div class="dialog-title"></div>
                    <div class="dialog-text"></div>
                    <input id="foo" type="link" value="" readonly="">
                </div>
                <div class="dialog-buttons">
                    <span class="dialog-button dialog-button-bold text-align-center text-color-primary" data-clipboard-action="copy" data-clipboard-target="#foo">复制链接</span>
                </div>
            </div>
            <div class="popover-backdrop"></div>
            <div class="toast">
                <div class="toast-content">
                    <div class="toast-icon"></div>
                    <div class="toast-text"></div>
                    <a class="toast-button"></a>
                </div>
            </div>
            
        </div>
    </div>
    <script type="text/javascript" src="js/yymh.js"></script>
    <script src="js/clipboard.min.js"></script>
    

    <script type="text/html" id="one_list_item">
    <div class="page-content">
        <div class="searchbar-found list">
            <ul>
                {{each list value i}}
                <li class="reader-zone-list-view-books">
                <div class="item-content">
                    <div class="item-inner">
                        <div class="display-flex justify-content-space-between width-100">
                            <a class="reader-book reader-book-default reader-book-round reader-book-media" href="/book.html?id={{value['id']}}">
                                <div class="">
                                    <div class="cover">
                        <img src="{{value['image']}}"/>
                                        {{if value['mhstatus']==0}}
                                            <span class="status" data-status="serialized">连载</span>
                                        {{/if}}
                                        {{if value['mhstatus']==1}}
                                            <span class="status" data-status="finish">完结</span>
                                        {{/if}}

                                        {{if value['tjswitch']==1}}
                                            <span class="type" data-type="recommend"></span>
                                        {{/if}}

                                        {{if value['isjingpin']==1}}
                                            <span class="type" data-type="competitive"></span>
                                        {{/if}}
                                        {{if value['xianmian']==1}}
                                            <span class="type" data-type="free_in_limit_time"></span>
                                        {{/if}}
                                    </div>
                                    <span class="name">{{value['title']}}</span>
                                    <p class="desc">{{value['desc']}}</p>
                                    <div class="footer">
                                        <span class="score"><i class="icon material-icons">star</i> {{value['mark']}}</span>
                                        <span class="readCount"><i class="icon material-icons">remove_red_eye</i> {{value['view']}}</span>
                                        <span class="author">作者：{{value['auther']}}</span>
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
                </div>
                </li>
                {{/each}}
                
            </ul>
        </div>
    </div>
    </script>

    <script type="text/html" id="one_list_item2">
<div class="page-content">
    <div class="searchbar-found list">
        <div class="text-align-center width-100 block" style="margin-top: 30vh;"><i class="icon material-icons color-gray" style="font-size: 5em;">storage</i>
            <p class="text-color-gray text-align-center">查询不到书籍~</p>
        </div>
    </div>
</div>

</script>

<script type="text/javascript">
    window.page = 1;
    window.loading = false;
    window.t=1;
    var searchBar = document.querySelector(".searchbar");
    var searchBarInput = document.querySelector(".searchbar input");
    var searchBarBtn = document.querySelector(".aui-searchbar .aui-searchbar-btn");
    var searchBarClearBtn = document.querySelector(".searchbar .input-clear-button");

    //初始化搜索条
    function initSearchBar(callback) {
        if (searchBar) {
            searchBarInput.onfocus = function() {
                $(this).addClass('input-focused');
            }
            // searchBarInput.oninput = function() {
            //     if (this.value.length) {
            //         searchBarClearBtn.style.display = 'block';
            //         searchBarBtn.classList.add("aui-text-info");
            //         searchBarBtn.textContent = "搜索";
            //     } else {
            //         searchBarClearBtn.style.display = 'none';
            //         searchBarBtn.classList.remove("aui-text-info");
            //         searchBarBtn.textContent = "取消";
            //     }
            // }
        }
        searchBarClearBtn.onclick = function() {
            this.style.display = 'none';
            searchBarInput.value = '';
            searchBarBtn.classList.remove("aui-text-info");
            searchBarBtn.textContent = "取消";
        }
        // searchBarInput.onblur = function() {
        //     var keywords = $('#searchbar').val();
        //     // alert(keywords);
        //     if (keywords.length) {
        //         searchBarInput.blur();
        //         callback(keywords);
        //     } else {
        //         this.style.marginRight = "-" + this.offsetWidth + "px";
        //         searchBarInput.value = '';
        //         searchBarInput.blur();
        //     }
        // }
        searchBarInput.onkeypress = function(e) {
          var keycode = e.keyCode;
          if(keycode=='13') {
              var keywords = $('#searchbar').val();
              // alert(keywords);
              if (keywords.length) {
                  searchBarInput.blur();
                  callback(keywords);
              } else {
                  this.style.marginRight = "-" + this.offsetWidth + "px";
                  searchBarInput.value = '';
                  searchBarInput.blur();
              }
              return false;
          }
            
        }
        /* searchBarBtn.onclick = function() {
            var keywords = searchBarInput.value;
            if (keywords.length) {
                searchBarInput.blur();
                callback(keywords);
            } else {
                this.style.marginRight = "-" + this.offsetWidth + "px";
                searchBarInput.value = '';
                searchBarInput.blur();
            }
        } */
    }

    //
    function changejphc(){
        appCenter.doPost(baseApi + "/carton/api/yymhindex",{ limit: 4, fz: 1, item: "jphc" },function (data) {
            if (data.code === 0) {
                var top=template('booklist',data);
                document.getElementById("jphc1").innerHTML = top;
            }
        })
    }
    //
    function changecnxh(){
        appCenter.doPost(baseApi + "/carton/api/yymhindex",{ limit: 5, type: 1, item: "cnxh" },function (data) {
            if (data.code === 0) {
                var top=template('booklist2',data);
                document.getElementById("cnxh").innerHTML = top;
            }
        })
    }

    //搜索条写入
    function searchBarWrite(text) {
        searchBarBtn.style.marginRight = 0;
        searchBarClearBtn.style.display = 'block';
        searchBarBtn.classList.add("aui-text-info");
        searchBarBtn.textContent = "搜索";
        searchBarInput.value = text;
    }
    
    function getSearchKey() {
        var keywords = $('#searchbar').val();
        if (keywords == '') {
            appCenter.showFailToast("请输入关键词");
          	return;
        }
        $('.pager-panel').text('正在加载中...');
        appCenter.showLoadingToast('正在加载中...');
        appCenter.doSearchKey(keywords,window.t, window.page, function(data) {
            var html = template("one_list_item", data);
            var html2 = template("one_list_item2", data);
            //是否添加
            $('.page-content-old').remove();
            if(data.code==0){
                $('.pager-panel').attr('lastpage', 'true');
                $('.pager-panel').text('暂无记录');
                $('.navbar').after(html2);
            }else{
                if (window.page <= 1) {
                    $('.navbar').after(html);
                } else {
                    $('.page-content').after(html);
                }
            }
            
            //是否到底
            if (data.lastPage) {
                $('.pager-panel').attr('lastpage', 'true');
                $('.pager-panel').text('数据到底');
            } else {
                $('.pager-panel').attr('lastpage', 'false');
                $('.pager-panel').text('点击加载更多');
            }
            
            window.toast.hide();
            $("img.lazy").lazyload();
        });
    }
    //加载更多
    function loadMore() {
        if ($('.pager-panel').attr('lastpage') == 'false') {
            window.page++;
            getSearch() ;
        }
    }
	function mk(keys){
		$("#searchbar").val(keys);
		getSearch();
	}
    
    //初始化
    $(function() {
        changejphc();
        changecnxh();
        initSearchBar(function(keywords) {
            getSearchKey();
        });
        var keyword = "";
        if (keyword != '') {
            searchBarWrite(keyword);
            getSearchKey(keyword);
        }
        var key = "";
        if (key != '') {
            searchBarWrite(key);
            getSearchKey();
        }
    });
</script>

</body>
</html>